package com.lzx.tease.controller.web;

import com.lzx.common.utils.R;
import com.lzx.tease.entity.GiveALike;
import com.lzx.tease.service.GiveALikeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2022/12/21
 * @Description
 */
@RestController
@RequestMapping("/tease/giveALike/web")
public class WebGiveALikeController {
    @Resource
    private GiveALikeService giveALikeService;

    //根据用户id查询用户点赞信息
    @GetMapping("/getGiveALikeList/{userId}")
    public R getGiveALikeList(@PathVariable Long userId) {
        return giveALikeService.getGiveALikeList(userId);
    }

    //点赞
    @PostMapping("/like")
    public R like(@RequestBody GiveALike giveALike) {
        return giveALikeService.like(giveALike);
    }
}
